package com.iflysse.dao;

import com.iflysse.pojo.po.common.CommonPoResp;
import com.iflysse.pojo.po.req.AddResourceVideoPoReq;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.springframework.stereotype.Repository;

import java.sql.SQLException;

@Repository
public interface ResourceVideoDao {
    /**
     * 添加video资源
     * @param addResourceVideoPoReq video资源请求对象
     * @return
     */
    @Insert({"insert into tb_resource_video (resource_id,video_name,video_path,video_size,video_duration) " +
            "values (uuid(),#{videoName},#{videoPath},#{videoSize},#{videoDuration})" })
    @Options(useGeneratedKeys = true, keyProperty = "resource_id")
    int addResourceVideo(AddResourceVideoPoReq addResourceVideoPoReq) throws SQLException;

}
